import request from '@/api/service'
//sino更新
import { parse } from 'search-params'
const search = window.location.search.substring(1) 
const parseSearch = parse(search) 
const PREMIXURI = '/api/visualdev/OnlineDev/'+parseSearch.sceneModuleId

export function getSceneInfo(id:any) {
  return request({
    url: `${PREMIXURI}/${id}`,
    method: 'get',
  })
}
export function updateScene(data:any) {
  return request({
    url: `${PREMIXURI}/${data.id}`,
    method: 'put',
    data
  })
}
export function addScene(data:any) {
  return request({
    url: `${PREMIXURI}`,
    method: 'post',
    data
  })
}
// 获取功能下拉框列表
export function getFeatureSelector(data:any) {
  return request({
    url: '/api/visualdev/Base/Selector',
    method: 'GET',
    data
  })
}
// 获取功能配置信息
export function getConfig(data:any) {
  return request({
    url: `/api/visualdev/OnlineDev/${data.id}/Config`,
    method: 'GET',
  })
}
export function getList(id:string,data:any) {
  return request({
    url: `/api/visualdev/OnlineDev/${id}/List`,
    method: 'POST',
    data
  })
}

// 获取字典数据下拉框列表
export function getDictionaryDataSelector(dictionaryTypeId:any) {
	return request({
		url: `/api/system/DictionaryData/${dictionaryTypeId}/Data/Selector`,
    method: 'GET',
	})
}
// 获取部门下拉框列表(公司+部门)
export function getDepartmentSelector() {
	return request({
		url: '/api/permission/Organize/Department/Selector/0',
    method: 'GET',
	})
}
// 获取接口数据
export function getDataInterfaceRes(id:string) {
  return request({
    url: `/api/system/DataInterface/${id}/Actions/Response`,
    method: 'GET'
  })
}

